<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
    
    <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <title><?php echo C('WEB_SITE_TITLE');?></title>
    
    <meta name="keywords" content="">
    <meta name="description" content="">
    
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    
    <link rel="shortcut icon" href="favicon.ico">
    <link href="/Admin/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="/Admin/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="/Admin/css/animate.min.css" rel="stylesheet">
    <link href="/Admin/css/style.min862f.css?v=4.1.0" rel="stylesheet">
    <script src="/Admin/js/jquery.min.js?v=2.1.4"></script>
    
    <style>
        .status{
            color: #FFF;
        }
        .status-0{
            background-color: #f8ac59;
        }
        .status-1{
            background-color: #1ab394;
        }
        .status-2{
            background-color: #ed5565;
        }
    </style>
</head>
<body>

</body>
</html>
    
    <link href="/Admin/css/plugins/iCheck/custom.css" rel="stylesheet">

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    
    <!-- Panel Other -->
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>配置项编辑</h5>
        </div>
        <div class="ibox-content">
            <div class="row row-lg">
                <div class="col-sm-12">
                    <script>
    $(function(){
        $(".alert").on('click',function(){
            console.log("tap");
            $(this).remove();
        });
    })
</script>
<?php switch($alert["status"]): case "0": ?><div class="alert alert-danger" style="text-align:center;"><?php echo ($alert["msg"]); ?></div><?php break;?>
    <?php case "1": ?><div class="alert alert-success" style="text-align:center;"><?php echo ($alert["msg"]); ?></div><?php break; endswitch;?>
                    <div class="clearfix" style="width:100%;">
                        <div class="bars pull-left">
                            <div class="btn-group hidden-xs" id="exampleTableEventsToolbar" role="group">
                                <button type="button" class="btn btn-outline btn-default" href="<?php echo U('Config/index');?>" style="padding-bottom: 8px;padding-top: 8px;">
                                    <i class="glyphicon glyphicon-chevron-left" aria-hidden="true"></i>
                                </button>
                                <button type="button" class="btn btn-outline btn-default" href="<?php echo U('Config/edit');?>" style="padding-bottom: 8px;padding-top: 8px;">
                                    <i class="glyphicon glyphicon-plus" aria-hidden="true"></i>
                                </button>
                                <button class="btn btn-default btn-outline" type="button" name="refresh" title="刷新" href="/admin.php/Config/edit/id/1.html" style="padding-bottom: 8px;padding-top: 8px;">
                                    <i class="glyphicon glyphicon-repeat"></i>
                                </button>
                                <button type="button" class="btn btn-outline btn-default confirm" href="<?php echo U('Config/delete',['id'=>$info['id']]);?>" style="padding-bottom: 8px;padding-top: 8px;">
                                    <i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
                                </button>
                            </div>
                        </div>
                    </div>
    
                    <form method="post" action="/admin.php/Config/edit/id/1.html" class="form-horizontal">
        
                        <div class="form-group">
                            
                            <div class="hr-line-dashed"></div>
                            
                            <label class="col-sm-2 control-label">状态
                                <!--<br><small class="text-navy">自定义样式</small>-->
                            </label>
            
                            <div class="col-sm-10">
                                <!--<select class="form-control" id="group" name="group">-->
                                <!--<option value="0">无分组</option>-->
                                <!--<?php $_result=C('CONFIG_GROUP_LIST');if(is_array($_result)): $i = 0; $__LIST__ = $_result;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$group): $mod = ($i % 2 );++$i;?>-->
                                <!--<option  value="<?php echo ($i); ?>" <?php if(($info["group"]) == $i): ?>selected="selected"<?php endif; ?> ><?php echo ($group); ?></option>-->
                                <!--<?php endforeach; endif; else: echo "" ;endif; ?>-->
                                <!--</select>-->
                                <div class="radio i-checks">
                                    <label>
                                        <input type="radio" value="1" name="status" <?php if(($info["status"]) == "1"): ?>checked="checked"<?php endif; ?>> <i></i> 启用</label>
                                </div>
                                <div class="radio i-checks">
                                    <label>
                                        <input type="radio" value="0" name="status" <?php if(($info["status"]) == "0"): ?>checked="checked"<?php endif; ?>> <i></i> 禁用</label>
                                </div>
                            </div>
                        </div>
        
                        <div class="hr-line-dashed"></div>
        
                        <div class="form-group">
                            <label class="col-sm-2 control-label">配置项标识</label>
                            <div class="col-sm-10">
                                <input name="name" type="text" class="form-control" value="<?php echo ((isset($info["name"]) && ($info["name"] !== ""))?($info["name"]):''); ?>">
                                <span class="help-block m-b-none">用于C方法调用，只能是英文且不能重复</span>
                            </div>
                        </div>
        
                        <div class="hr-line-dashed"></div>
        
                        <div class="form-group">
                            <label class="col-sm-2 control-label">配置项名称</label>
                            <div class="col-sm-10">
                                <input name="title" type="text" class="form-control" value="<?php echo ((isset($info["title"]) && ($info["title"] !== ""))?($info["title"]):''); ?>">
                                <span class="help-block m-b-none">用于后台显示的标题</span>
                            </div>
                        </div>
        
                        <div class="hr-line-dashed"></div>
        
                        <div class="form-group">
                            <label class="col-sm-2 control-label">排序</label>
                            <div class="col-sm-4">
                                <input name="sort" type="text" class="form-control" value="<?php echo ((isset($info["sort"]) && ($info["sort"] !== ""))?($info["sort"]):''); ?>">
                                <span class="help-block m-b-none">用于分组显示的排序</span>
                            </div>
                        </div>
    
                        <div class="hr-line-dashed"></div>
    
                        <div class="form-group">
                            <label class="col-sm-2 control-label">配置类型</label>
                            <div class="col-sm-10">
                                <select class="form-control" id="type" name="type">
                                    <?php $_result=C('CONFIG_TYPE_LIST');if(is_array($_result)): $i = 0; $__LIST__ = $_result;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$type): $mod = ($i % 2 );++$i;?><option  value="<?php echo ($key); ?>" <?php if(($info["type"]) == $key): ?>selected="selected"<?php endif; ?> ><?php echo ($type); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                                </select>
                                <span class="help-block m-b-none">系统会根据不同类型解析配置值</span>
                            </div>
                        </div>
    
                        <div class="hr-line-dashed"></div>
        
                        <div class="form-group">
                            <label class="col-sm-2 control-label">分组</label>
                            <div class="col-sm-10">
                                <select class="form-control" id="group" name="group">
                                    <option value="0">无分组</option>
                                    <?php $_result=C('CONFIG_GROUP_LIST');if(is_array($_result)): $i = 0; $__LIST__ = $_result;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$group): $mod = ($i % 2 );++$i;?><option  value="<?php echo ($i); ?>" <?php if(($info["group"]) == $i): ?>selected="selected"<?php endif; ?> ><?php echo ($group); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                                </select>
                                <span class="help-block m-b-none">配置分组，用于显示在目标配置页，不分组则不显示</span>
                            </div>
                        </div>
        
                        <div class="hr-line-dashed"></div>
        
                        <div class="form-group">
                            <label class="col-sm-2 control-label">配置值</label>
                            <div class="col-sm-10">
                                <textarea name="value" class="form-control" rows="4"><?php echo ((isset($info["value"]) && ($info["value"] !== ""))?($info["value"]):''); ?></textarea>
                                <span class="help-block m-b-none">配置值</span>
                            </div>
                        </div>
        
                        <div class="hr-line-dashed"></div>
        
                        <div class="form-group">
                            <label class="col-sm-2 control-label">配置项</label>
                            <div class="col-sm-10">
                                <textarea name="extra" class="form-control" rows="4"><?php echo ((isset($info["extra"]) && ($info["extra"] !== ""))?($info["extra"]):''); ?></textarea>
                                <span class="help-block m-b-none">如果是枚举型，需要配置该项</span>
                            </div>
                        </div>
        
                        <div class="hr-line-dashed"></div>
        
                        <div class="form-group">
                            <label class="col-sm-2 control-label">配置项说明</label>
                            <div class="col-sm-10">
                                <textarea name="remark" class="form-control" rows="4"><?php echo ((isset($info["remark"]) && ($info["remark"] !== ""))?($info["remark"]):''); ?></textarea>
                                <span class="help-block m-b-none">配置详细说明</span>
                            </div>
                        </div>
        
                        <div class="hr-line-dashed"></div>
        
                        <input type="hidden" name="id" value="<?php echo ((isset($info["id"]) && ($info["id"] !== ""))?($info["id"]):''); ?>"/>
        
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-2">
                                <button class="btn btn-primary" type="submit">保存内容</button>
                                <button class="btn btn-white" type="submit" onclick="window.history.go(-1);">取消</button>
                            </div>
                        </div>
                    </form>
                </div>
                
            </div>
        </div>
    </div>
    <!-- End Panel Other -->
</div>
<!--<script src="/Admin/js/jquery.min.js?v=2.1.4"></script>-->
<script src="/Admin/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/Admin/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="/Admin/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="/Admin/js/plugins/layer/layer.min.js"></script>
<script src="/Admin/js/hplus.min.js?v=4.1.0"></script>
<script src="/Admin/js/contabs.min.js"></script>
<script src="/Admin/js/plugins/pace/pace.min.js"></script>
<script>
    $("button").on('click',function(){
        if ( $(this).hasClass("confirm") ) {
            if ( !confirm("确定要执行操作吗?") ) {
                console.log("取消操作");
                return;
            } else {
                console.log("继续操作");
            }
        }
        var href = $(this).attr("href");
        var form = $(this).attr("form");
        var action = $(this).attr("action");
        if ( href ){
            window.location.href = href;
        } else if ( form && action ) {
            $("#"+form)
                .attr("action",action)
                .submit();
        }
    });

    $("input[name=checkAll]").on('change',function(){
        console.log("改变了");
        console.log($(this).prop("checked"));
        var child = $(this).attr("child");
        if ( $(this).prop("checked") ) {
            $("."+child).prop("checked",true);
        } else {
            $("."+child).prop("checked",false);
        }
    });

</script>

<script src="/Admin/js/content.min.js?v=1.0.0"></script>
<script src="/Admin/js/plugins/iCheck/icheck.min.js"></script>
<script src="/Admin/js/plugins/summernote/summernote.min.js"></script>
<script src="/Admin/js/plugins/summernote/summernote-zh-CN.js"></script>

<script>
    $(document).ready(function(){$(".i-checks").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green",})});
    $(document).ready(function(){$(".summernote").summernote({lang:"zh-CN"})});var edit=function(){$("#eg").addClass("no-padding");$(".click2edit").summernote({lang:"zh-CN",focus:true})};var save=function(){$("#eg").removeClass("no-padding");var aHTML=$(".click2edit").code();$(".click2edit").destroy()};
</script>
</body>
</html>